<template>
  <div class="all">
    <div class="common">
      <router-link class="identify" to="identify">
        <div class="idt-title">病害识别</div>
        <img class="idt-img" src="../assets/pic/expert-search.jpg" alt="">
      </router-link>

      <router-link class="identify" to="diseasesSelect">
        <div class="idt-title">病害查询</div>
        <img class="idt-img" src="../assets/pic/disease-search.jpg" alt="">
      </router-link>

      <router-link class="identify" to="expertSelect">
        <div class="idt-title">专家查询</div>
        <img class="idt-img" src="../assets/pic/identify.jpg" alt="">
      </router-link>
    </div>
    <div class="rectangle">
      <router-link to="/center/question" v-show="loginUser.role === '农户' || !loginUser.isLogin">
        <div class="rectangle-title">咨询专家</div>
        <img class="" src="../assets/pic/question.jpg" alt="">
      </router-link>

<!--      <router-link to="">-->
<!--        <div class="rectangle-title">商品购买</div>-->
<!--        <img class="" src="../assets/pic/shopping.jpg" alt="">-->
<!--      </router-link>-->
    </div>
  </div>
</template>

<script>
import {mapState} from "vuex";

export default {
  name: "Service",
  computed:{
    ...mapState('user',['loginUser'])
  }
}
</script>

<style scoped>

.all{
  animation: run 1s ease;
}

.common{
  display: flex;
  justify-content: space-around;
}

.identify{
  color: #e9e9e9;
  float: left;
  position: relative;
}

.idt-title {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  color: #e9e9e9;
  font-size: 40px;
  text-align: center;
  line-height: 360px;
  z-index: 9;
  transition: .3s linear;
  border-radius: 50%;
}

.idt-img{
  border-radius: 50%;
  vertical-align: top;
  max-width: 100%;
  width: 360px;
  transition: .3s linear;
}

.identify:hover img{
  transform: translateX(-10px) translateY(-10px) rotateZ(-90deg);
}

.identify:hover .idt-title{
  transform:translateX(-10px) translateY(-10px);
  box-shadow: 10px 10px 10px rgba(0,0,0,.5);
}

.rectangle {
  margin-top: 50px;
  display: flex;
  justify-content: space-around;
}

.rectangle a{
  display: block;
  position: relative;
  transition: .3s;
}

.rectangle img{
  width: 550px;
  vertical-align: top;
}

.rectangle a:hover{
  transform: translateX(-5px) translateY(-5px);
  box-shadow: 10px 10px 10px rgba(0, 0, 0, .5);
}

.rectangle-title{
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  color: #e9e9e9;
  font-size: 40px;
  text-align: center;
  line-height: 310px;
  z-index: 9;
}

</style>